﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MobilePage.aspx.cs" Inherits="JsonServer.MobilePage" %>

<%@ Register TagPrefix="mobi" Namespace="System.Web.UI.MobleControls" Assembly="System.Web.Mobile" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
   <mobi:form id="form1" runat="server" style="background-color: #00FFFF; width: 350px">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanelOfMonthPage" runat="server">
        <ContentTemplate>
            
            <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
                DeleteMethod="Delete" 
                OldValuesParameterFormatString="original_{0}" SelectMethod="GetDataByMonth" 
                TypeName="JsonServer.PowerDataSetTableAdapters.PowerTableAdapter" 
                UpdateMethod="Update" InsertMethod="Insert">
                <DeleteParameters>
                    <asp:Parameter Name="Original_Id" Type="Int32" />
                </DeleteParameters>
                <InsertParameters>
                    <asp:Parameter Name="Id" Type="Int32" />
                    <asp:Parameter Name="Power" Type="String" />
                    <asp:Parameter Name="CreateTime" Type="String" />
                </InsertParameters>
                <SelectParameters>
                    <asp:ControlParameter ControlID="TextBoxOfMonthPageYear" Name="YEAR" 
                        PropertyName="Text" Type="String" DefaultValue="2012" />
                    <asp:ControlParameter ControlID="TextBoxOfMonthPageMonth" Name="MONTH" 
                        PropertyName="Text" Type="String" DefaultValue="12" />
                </SelectParameters>
                <UpdateParameters>
                    <asp:Parameter Name="Power" Type="String" />
                    <asp:Parameter Name="CreateTime" Type="String" />
                    <asp:Parameter Name="Original_Id" Type="Int32" />
                </UpdateParameters>
            </asp:ObjectDataSource>
            
            &nbsp;&nbsp;&nbsp;Year:
            <mobi:TextBox ID="TextBoxOfMonthPageYear" runat="server"></mobi:TextBox>
            <br />
            <br />
            Month:
            <mobi:TextBox ID="TextBoxOfMonthPageMonth" runat="server"></mobi:TextBox>
            <br />
            <br />
            <mobi:Button ID="ButtonCalculateMonthPower" runat="server" 
                onclick="ButtonCalculateMonthPower_Click" Text="Calculate" />
            <br />
            <br />
            <mobi:Label ID="LabelMonthPower" runat="server"></asp:Label>
            <br />
            <br />
            <mobi:Chart ID="Chart1" runat="server" DataSourceID="ObjectDataSource1">
                <Series>
                    <asp:Series ChartType="Spline" Name="Series1" XValueMember="CreateTime" 
                        YValueMembers="Power">
                    </asp:Series>
                </Series>
                <ChartAreas>
                    <mobi:ChartArea Name="ChartArea1">
                    </mobi:ChartArea>
                </ChartAreas>
            </mobi:Chart>
            <br />
            <br />
            <mobi:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"
                AutoGenerateColumns="False" DataKeyNames="Id" DataSourceID="ObjectDataSource1"
                PageSize="30" CellPadding="4" ForeColor="#333333" GridLines="None" 
                Width="250px">
                <AlternatingRowStyle BackColor="White" />
                <Columns>
                    <asp:BoundField DataField="Id" HeaderText="Id"
                        SortExpression="Id" InsertVisible="False" ReadOnly="True" />
                    <asp:BoundField DataField="Power" HeaderText="Power" SortExpression="Power" />
                    <asp:BoundField DataField="CreateTime" HeaderText="CreateTime" 
                        SortExpression="CreateTime" />
                </Columns>
                <EditRowStyle BackColor="#2461BF" />
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#EFF3FB" />
                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                <SortedAscendingCellStyle BackColor="#F5F7FB" />
                <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                <SortedDescendingCellStyle BackColor="#E9EBEF" />
                <SortedDescendingHeaderStyle BackColor="#4870BE" />
            </mobi:GridView>
        </ContentTemplate>
    </asp:UpdatePanel>
    <div>
    </div>
    </mobi:form>
</body>
</html>
